package com.mybatisplus.demo05;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybatisplus.demo05.entity.SystemUser;
import com.mybatisplus.demo05.mapper.UserMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest
public class DemoTest05 {
    @Autowired
    private UserMapper userMapper;

    @Test
    public void testSelect() {
        IPage page = new Page(1, 3);
        List<Map<String, Object>> pageResult = userMapper.selectTest(page, "");
        pageResult.forEach(System.out::println);
    }
    @Test
    public void testSelect2() {
        IPage page = new Page(1, 3);
        List<Map<String, Object>> pageResult = userMapper.selectTest(page, "江");
        pageResult.forEach(System.out::println);
    }
}
